package com.itheima.test;

public class InheritanceExample {
	public static void main(String[] args) {
		ChildClass child = new ChildClass();
		child.parentMethod(); // 调用父类的重载方法
		child.childMethod(); // 调用子类方法

		// 访问父类和子类的变量
		child.parentVariable = 10;
		child.childVariable = 20;
		System.out.println("Parent variable: " + child.parentVariable);
		System.out.println("Child variable: " + child.childVariable);
	}
}
